﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IoCTechDay.HollywoodPrinciple;

namespace IoCTechDay.DependencyInjection
{
    class DependencyInjectionDemo
    {
        public static void Run()
        {
            Console.Clear();
            Console.WriteLine("Starting Dependency Injection Demo");
            // Note here WE are in control of who the Director is working with!
            List<IActor> actors = new List<IActor>();
            actors.Add(new AustrianDeathMachine());
            actors.Add(new VanDamme());
            actors.Add(new TomHanks());

            DependentHollywoodDirector director = 
                new DependentHollywoodDirector(actors);

            Console.WriteLine("Rolling Film!");
            director.Action();

            Console.WriteLine("Oops! Someone Screwed Up!");
            director.Cut();

            Console.WriteLine("Press Enter to Continue...");
            Console.ReadLine();
        }
    }
}
